package casa.depesos.app.com.http.data;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class City {

    @SerializedName("town")
    @Expose
    public String name;

    @SerializedName("townId")
    @Expose
    public String code;

    @SerializedName("region")
    @Expose
    public String province;

    @SerializedName("regionId")
    @Expose
    public String provinceCode;

    @NonNull
    @Override
    public String toString() {
        return name;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (obj instanceof City == false) {
            return false;
        }
        City tmp = (City) obj;
        return TextUtils.equals(name, tmp.name) && TextUtils.equals(code, tmp.code);
    }
}
